import request from '@/utils/request'

const api_name = '/customer'
export default {
  showNames(selected) {
    return request({
      url: `${api_name}/namees`,
      method: 'get',
      params: { selected }
    })
  },
  getPrice(month) {
    return request({
      url: `${api_name}/price`,
      method: 'get',
      params: { month }
    })
  },
  getTimeList() {
    return request({
      url: `${api_name}/list`,
      method: 'get'
    })
  },
  allCustomer(customerData) {
    return request({
      url: `${api_name}/allCustomer`,
      method: 'post',
      data: customerData
    })
  },
  deleteCustomer(id) {
    return request({
      url: `${api_name}/deleteCustomer/${id}`,
      method: 'delete'
    })
  },
  addCustomer(customerInfo) {
    return request({
      url: `${api_name}/addCustomer`,
      method: 'post',
      data: customerInfo
    })
  },
  updateCustomer(customersInfo) {
    return request({
      url: `${api_name}/updateCustomer`,
      method: 'post',
      data: customersInfo
    })
  },
  showName() {
    return request({
      url: `${api_name}/selectNames`,
      method: 'get'
    })
  },
  selectAllCustmer(data) {
    return request({
      url: `${api_name}/allCustomer`,
      method: 'post',
      data: data
    })
  }
}
